@extends('layouts.default')
@section('content') 
<div class="box">
    <header>
        <div class="icons">
            <i class="fa fa-table"></i>
        </div>
        <h5>{{ Lang::get('messages.update_history') }}</h5>
    </header>
    <div id="collapse4" class="body">
        <table id="dataTable" class="table table-bordered table-condensed table-hover table-striped">
            <thead>
                <tr>
                    <th>{{ Lang::get('messages.vehicle') }}</th>
                    <th>{{ Lang::get('messages.action') }}</th>
                    <th>{{ Lang::get('messages.date') }}</th>
                </tr>
            </thead>
            <tbody>
                @foreach($car_update as $c )
                <tr>
                    <td>{{ $c->make.' '.$c->license}}</td>
                    <td><p class="text-info">{{ isset($c->username)?$c->username:'' }} 
                            {{  Lang::get('messages.changed')}} {{ Lang::get('history.'.$c->key) }} 
                            from {{ isset($c->old_value)?$c->old_value: Lang::get('messages.empty') }} 
                            to {{ $c->new_value }}</p></td>     
                    <td><p class="text-warning">{{ $c->updated_at }}</p></td>  
                </tr>
                @endforeach
                @foreach($insurdoc_update as $i )
                <tr>
                    <td>{{ $i->make.' '.$i->license}}</td>
                    <td><p class="text-info">{{ isset($i->username)?$i->username:'' }} 
                            {{  Lang::get('messages.changed')}} {{ Lang::get('history.'.$i->key) }} 
                            from {{ isset($i->old_value)?$i->old_value:Lang::get('messages.empty') }} 
                            to {{ $i->new_value }}</p></td>     
                    <td><p class="text-warning">{{ $i->updated_at }}</p></td>  
                </tr>
                @endforeach
                @foreach($repair_parts as $p )
                <tr>
                    <td></td>
                    <td><p class="text-info">{{ isset($p->username)?$p->username:'' }} 
                            {{  Lang::get('messages.changed')}} {{ Lang::get('history.'.$p->key) }} 
                            from {{ isset($p->old_value)?$p->old_value:Lang::get('messages.empty') }} 
                            to {{ $p->new_value }}</p></td>     
                    <td><p class="text-warning">{{ $p->updated_at }}</p></td>  
                </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</div>
@stop

